﻿using System;
using System.Web;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using gms.security;

namespace gms.data {
	public class Acl_Group {
#region Properties
		public int acl_id { get; set; }
		public string name { get; set; }
		public string description { get; set; }
		public long acl_bits { get; set; }
#endregion
#region Constructors

#endregion
#region Additional Loads

#endregion
#region CRUD

#endregion
#region Utilities
		public bool test(Acl_Field test_against) {
			return ((acl_bits & (long)test_against) == (long)test_against);
		}
		private void fill(DataSet values) {
			if (!Database.dataset_is_empty(values)) {
				for (int i = 0; i < values.Tables[0].Columns.Count; i++) {
					switch (values.Tables[0].Columns[i].ColumnName) {
						case "acl_id": acl_id = (int)values.Tables[0].Rows[0]["acl_id"]; break;
						case "name": name = (string)values.Tables[0].Rows[0]["name"]; break;
						case "description": description = (string)values.Tables[0].Rows[0]["description"]; break;
						case "acl_bits": acl_bits = (long)values.Tables[0].Rows[0]["acl_bits"]; break;
					}
				}
			}
		}
#endregion

		

		

		

		

		

		
	}
}